<div class="layui-card">
    <div class="layui-card-header">
        <h2>服务配置</h2>
    </div>
    <div class="layui-card-body">
        <form class="layui-form" >
            <div class="layui-form-item">
                <label for="" class="layui-form-label">坐席并发数</label>
                <div class="layui-input-inline">
                    <input type="number" name="forzar_sobrecolocar" placeholder="请输入数字" lay-verify="required" class="layui-input" value="<?php echo $data['dialer.forzar_sobrecolocar']['config_value']; ?>" >
                </div>
                <div class="layui-form-mid layui-word-aux">该值+任务的并发值将影响群呼并发数</div>
            </div>
            <div class="layui-form-item">
                <label for="" class="layui-form-label">呼叫时长</label>
                <div class="layui-input-inline">
                    <input type="number" name="timeout_originate" placeholder="请输入数字" lay-verify="required" class="layui-input" value="<?php echo $data['dialer.timeout_originate']['config_value']; ?>" >
                </div>
                <div class="layui-form-mid layui-word-aux">在N秒内客户未接听则挂断,0为不设置，系统将默认为30秒</div>
            </div>
            <div class="layui-form-item">
                <label for="" class="layui-form-label">接听延迟</label>
                <div class="layui-input-inline">
                    <input type="number" name="tiempo_contestar" placeholder="请输入数字" lay-verify="required" class="layui-input" value="<?php echo $data['dialer.tiempo_contestar']['config_value']; ?>" >
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit="" lay-filter="submitForm">确认</button>
                </div>
            </div>
        </form>
    </div>
</div>


<?php
$url = yii\helpers\Url::to(['config']);

$js = <<<JS
    layui.use(['form','element','table', 'layer','laydate'],function() {
        var form = layui.form;  
        var element = layui.element;  
        var table = layui.table;  
        var layer = layui.layer;  
        
        //监听表单提交
        form.on('submit(submitForm)',function(data) {
            var index = layer.load()
            var where = data.field
            $.post("{$url}",where,function(res) {
                layer.close(index)
                layer.msg(res.msg)   
            })
            return false
        })
    });
JS;
$this->registerJs($js);
